# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Arvedui <arvedui@posteo.de>

pkgbase=python-retrying
pkgname=(python-retrying python2-retrying)
pkgver=1.3.3
pkgrel=9
pkgdesc="A general purpose Python retyring library"
arch=('any')
url="https://github.com/rholder/retrying/releases"
license=('Apache')
makedepends=('python-setuptools' 'python2-setuptools' 'python-six' 'python2-six')
source=("https://github.com/rholder/retrying/archive/v$pkgver.tar.gz")
md5sums=(85ccf5a3a8b32d4091bcde8dabfce060)

prepare() {
  cd "$srcdir"
  cp -a retrying-$pkgver{,-py2}
}

build() {
  cd "$srcdir"/retrying-$pkgver
  python setup.py build

  cd "$srcdir"/retrying-$pkgver-py2
  python2 setup.py build
}

check() {
  cd "$srcdir"/retrying-$pkgver
  python setup.py test

  cd "$srcdir"/retrying-$pkgver-py2
  python2 setup.py test
}

package_python-retrying() {
  depends=('python-six')

  cd "$srcdir/retrying-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1
}

package_python2-retrying() {
  depends=('python2-six')

  cd "$srcdir/retrying-$pkgver-py2"
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

# vim:set ts=2 sw=2 et:
